<template>
  <div>
    <ul>
        <li v-for="(item,index) in arr" :key="index">{{item}}<button @click="sc(index)">删除</button></li>
    </ul>
   <button @click="app1">生成</button>
  </div>
</template>

<script>
export default {
  data(){
    return {
        arr:[],
        
    }
  },
  methods:{
    app1(){
      
        this.arr.push(Math.floor(Math.random()*51+50))
    },
    sc(i){


        this.arr.splice(i,1)
    },
  }
}
</script>

<style scoped>

</style>